package JDialogs;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JPanel;

public class Aufgabe_dialogs_panes extends JFrame {

	
	static Aufgabe_dialogs_panes con; 
	
	public Aufgabe_dialogs_panes(String title){
		
		super(title);
		
		this.setBounds(480,220,300,300);
		JPanel pane =new JPanel();
		this.add(pane);
		JButton button1 = new JButton("Open Dialog1");
		pane.add(button1);
		
		button1.addActionListener(new ActionListener() {
		
			public void actionPerformed(ActionEvent e) {
				dialog1();
				
			}
		});

		JButton button2 = new JButton("Open Dialog2");
		pane.add(button2);
		
		button2.addActionListener(new ActionListener() {
		
			public void actionPerformed(ActionEvent e) {
				dialog2();
				
			}
		});
		
		
		
		this.setVisible(true);
		
		
	}
	
	
	public void dialog1(){
		
		JDialog dial1 = new JDialog(con,"Hallo",true);
		
		dial1.setBounds(530, 250, 100, 90);
		dial1.setVisible(true);
		
	}
	
	public void dialog2(){
		
	}
	
	public static void main(String args[]){
		
		con =new Aufgabe_dialogs_panes("Dialogs");
	}
	
	

}
